<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="logic" uri="http://struts.apache.org/tags-logic"%>
<%@taglib prefix="html" uri="http://struts.apache.org/tags-html"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<bean:define id="role" value="${auth.role.roleType}" scope="session" />
<logic:equal name="role" value="admin">
	<html:form action="/flightAddAction">
		<h1>
			<bean:message key="flight.title.add" />
		</h1>
		<br />
		<bean:message key="flight.add.choose.flightcrew" />
		<html:select property="flightCrewId" title="Available crew">
			<html:option value="-1">
				<bean:message key="flight.noFlightCrewSelected" />
			</html:option>
			<html:options collection="flightCrews" property="flightCrewId"
				labelProperty="flightCrewName" />
		</html:select>
		<br />
		<bean:message key="flight.add.choose.plane" />
		<html:select property="planeId" title="Available plane">
			<html:option value="-1">
				<bean:message key="flight.noPlaneSelected" />
			</html:option>
			<html:options collection="planes" property="planeId"
				labelProperty="model" />
		</html:select>
		<br />

		<html:submit>
			<bean:message key="flight.add" />
		</html:submit>

	</html:form>
</logic:equal>